<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php

ini_set('include_path','../libs' . PATH_SEPARATOR . ini_get('include_path'));

require 'JsClasses.php';    # JsClasses Required
require 'CssOptimizer.php'; # CssOptimizer Required
 
$jsClasses = new JsClasses(array(
	'classesPath' => '../js',
	'classesCacheDir' => '../cache'
));
$jsClasses->make(array('Ria_JsonRequest_Test'));
$classesResultJsFileName = $jsClasses->getJsFileName();

$cssOptimizer = new CssOptimizer(array(
 	'cssCacheDir' => '../cache'
));
$cssOptimizer->optimize('css/screen_orig.css');
$cssResultFileName = $cssOptimizer->getCssFileName();

?>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Simple JsClasses Integration on PHP Site Engine</title>

	<link rel="stylesheet" href="<?php echo $cssResultFileName ?>" type="text/css" media="screen, projection">
	<script type="text/javascript" src="js/mootools-1.2.4-core-nc.js"></script>
	<script type="text/javascript" src="<?php echo $classesResultJsFileName ?>"></script>
</head>

<body>
	<div class="container">
		<h1>RIA JsClasses Test Page</h1>
		<hr>
                    <p>Version <?php echo $jsClasses->getVersion()?></p>
		<form>
			<input type="button" id="jsonTestRequestButton" value="Test JSON Request" />
			<script>
				/**
				 * HTML Request Simple
				 */
				$('jsonTestRequestButton').addEvent('click', function() { 
					new Ria_JsonRequest_Test({
						myParam1 : 23, 
						myParam2 : 'simple text'
					});
				});
			</script>
		</form>
	</div>
	
</body>
</html>
